<script src='https://unpkg.com/vue@2.1.10/dist/vue.js'></script>
<!--过滤的简单使用-->
<div id="app">
减一的数值是：{{count|test('123456')}}
</div>
<script>
    Vue.filter('test',function(value,format){
        //进行减一操作
        console.log('value='+value);
        console.log('format='+format);
        if(value==3){
            return value-1;
        }else{
            return value;
        }
    });
    var vm=new Vue({
        el:'#app',
        data:{
            count:3
        }
    });
</script>